#ifndef		_WIN32
#include	"ThreadUnix.hpp"

bool		ThreadUnix::create(myThread *var,			\
				   void *(*pt2Func)(void *),void *param)
{
  bool	ret = true;
  int	retVal = 0;

  retVal = pthread_create(var, NULL, *pt2Func, param);
  if (retVal != 0)
    ret = false;
  return (ret);
}

void			ThreadUnix::teminate(myThread *var)
{
  pthread_cancel(*var);
  return ;
}

void			ThreadUnix::waitSingle(myThread *var)
{
  pthread_join(*var, NULL);
  return ;
}
void			ThreadUnix::waitMultiple(myThread *var, int nb)
{
  int	i = 0;
  while (i < nb)
    {
      pthread_join(var[i], NULL);
      ++i;
    }
  return ;
}
void			ThreadUnix::exit()
{
  pthread_exit(NULL);
  return ;
}
#endif /* !_WIN32 */
